#ifndef _KLAS_PARTICLE_ENGINE_HPP_
#define _KLAS_PARTICLE_ENGINE_HPP_

#include "../include/ParticleEmitter.hpp"
#include "../include/Camera.hpp"
#include <list>
using namespace std;

namespace klas
{
  //! The particle engine manages a set of emitters.
  class ParticleEngine
  {
    public:

      //! Ctor.
      ParticleEngine();

      //! Dtor.  Deletes all connected emitters.
      ~ParticleEngine();

      //! Adds a new emitter to the engine.
      /*! \param emitter The emitter to add. */
      void addEmitter(ParticleEmitter* emitter);

      //! Emits particles.
      /*! \param emitter The emitter to emit particles from.  If not given, then particles are emitted from all connected emitters. */
      void emitParticles(ParticleEmitter* emitter = 0);

      //! Updates particles.
      /*! \param dt The time since the last update. */
      void update(Real dt);

      //! Renders the particles
      void render(const Camera& cam);

    private:

      //! A list of all connected emitters.
      list<ParticleEmitter*> m_emitters;

  };
}

#endif
